Skip to content

chore: pnpm gates runs one at a time per machine - #2180

Merged
yw0nam merged 1 commit into
mainfrom
chore/gates-lock
Nov 30, 2026
Merged

yw0nam merged 1 commit into
mainfrom
chore/gates-lock

Conversation

@yw0nam

@yw0nam yw0nam commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Summary

pnpm gates (scripts/ci/gates.sh) takes a machine-wide lock, /tmp/yui-gates-<uid>.lock (a directory holding the holder's pid), so a second run on the same machine prints one wait line and starts when the first ends. A lock whose pid is no longer alive is taken over. The lock is removed on exit.

Why: on 2026-11-30 three task worktrees of #2179 ran pnpm gates at once on a 12-core Mac; load average reached 154 (uptime), and pnpm test failed with 5000 ms timeouts in tests the changes did not touch (32 cases in one run, 9 in a rerun, about 18 in another), each passing when run alone. Waiting costs less than a starved run plus its rerun.

The workflow side changes with it (outside the repo, in the shared .claude skill): task implementers run only their changed tests, the type check and biome, and pnpm gates runs once per change on the integration or PR branch.

Related issues

Runtime evidence

The lock block run on its own (bash -c with the block sourced):

  • a lock left by a dead pid (999999): taken over at once, released on exit;
  • a lock held by a live sleep 7: printed wait another gates run holds the lock (pid …), took the lock 10 s later (one 5 s poll after the holder ended), released on exit.

Verification

  • bash scripts/ci/test-guard.sh origin/main and bash scripts/ci/rule-tests.sh origin/main exit 0
  • No app code changes; CI does not run gates.sh

Checklist (YUI principles)

  • Docs: CONTRIBUTING.md says gates run one at a time per machine

…es stop starving each other into test timeouts
@yw0nam
yw0nam merged commit c528d4c into main Nov 30, 2026
12 checks passed
@yw0nam
yw0nam deleted the chore/gates-lock branch November 30, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant